<template>
<div>
  <header class="header">
      <div class="container top">
        <h1 class="logo">
          <nuxt-link to="/"><img src="~assets/images/logo.png" alt=""></nuxt-link>
        </h1>
        <div v-on:click="menuClick" v-bind:class="{navClose: menuScenn,navx:navX}"></div>
        <div :class="{navBg:menuScenn}"></div>
        <div :class="{topShow:menuScenn,top_nav:navX}">
          <div class="top_t">
            <span class="q"><i class="fa fa-qq"></i>&nbsp;前端交流群：323750798</span>
          </div>
          <ul class="nav">
            <li :class="{navActive:JSON.stringify(params)=='{}'}"><nuxt-link to="/" title="首页">首页</nuxt-link></li>
            <li class="item" v-for="i in headerData.data" :key="i.id" :class="{navActive:(params.id==i.navTagname)}">
              <nuxt-link v-if="i.navTagname.indexOf('http')==-1" :to="`/${i.navTagname}`" :title="i.navText">{{i.navText}}</nuxt-link>
              <a :href="i.navTagname" target="_blank" :title="i.navText" v-else>{{i.navText}}</a>
            </li>
          </ul>
        </div>
      </div>
    </header>
     <div class="newTwiter">
      <p><strong>签名：</strong>男人，为了以后的生活，现在就要对自己狠点</p>
    </div>
</div>
</template>
<script>
import util from "../util/serve";
export default {
  props: {
    headerData: {
      type: Object,
      default: function() {
        return {
          status: 0,
          data: []
        };
      }
    },
    params: {
      type: Object,
      default: function() {
        return {
          status: 0,
          id: []
        };
      }
    }
  },
  data() {
    return {
      menuScenn: false,
      navX: true,
      current: "/"
    };
  },
  methods: {
    menuClick: function() {
      if (this.menuScenn) {
        this.menuScenn = false;
      } else {
        this.menuScenn = true;
      }
    }
  }
};
</script>

<style lang="less">
/*引用reset.css*/
@import "./assets/css/reset.css";
/*头部样式*/

.header {
  width: 100%;
  overflow: hidden;
  background: #fff;
  .logo {
    float: left;
    margin: 0;
    width: 200px;
    img {
      width: 100%;
    }
    a {
      display: block;
    }
  }
  .top_nav {
    overflow: hidden;
    .nav {
      overflow: hidden;
      float: right;
      li {
        line-height: 45px;
        float: left;
        position: relative;
        margin: 0 15px;
      }
      li a {
        // margin: 0 15px;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        font-size: 18px;
        font-weight: 200;
        line-height: 48px;
        transition: color 0.5s;
        &::before {
          content: "";
          position: absolute;
          height: 1px;
          bottom: 0;
          left: 50%;
          width: 0%;
          transform: translateX(-50%);
          background: #58b0e0;
          transition: backgroundColor 0.2s, width .3s;
        }
        &:hover {
          color: #58b0e0;
        }
        &:hover::before {
          width: 100%;
        }
      }
      li.navActive a {
        color: #58b0e0;
        &:before {
          background: currentColor;
          width: 100%;
        }
        transition: all 3s;
      }
    }
    .top_t {
      line-height: 35px;
      text-align: right;
      width: 100%;
      display: inline-block;
      span {
        float: right;
        padding-right: 15px;
      }
    }
  }
}
/*碎语*/

.newTwiter {
  height: 20px;
  line-height: 20px;
  padding: 8px 10px;
  color: #666;
  font-size: 13px;
  background-color: #fff;
  margin: 10px auto;
}

.newTwiter p {
  margin: 0;
  overflow: hidden;
  height: 20px;
}

.newTwiter p strong {
  color: #56af45;
}
/*end碎语*/
/*底部样式*/

.footer {
  color: #aaa;
  font-size: 12px;
  width: 100%;
}

.copyright {
  padding: 18px 20px 12px;
  line-height: 20px;
  background-color: #414141;
  border-left: 20px solid #00a2ca;
}

.co {
  height: 20px;
}

.fo {
  float: left;
  margin: 0 15px 0 0;
}

.copyright a {
  color: #aaa;
}

.copyright a:hover {
  color: #fff;
}

.scrollTop {
  position: fixed;
  right: 20px;
  bottom: 50px;
  z-index: 999;
  width: 42px;
  display: none;
}

.fadeUp {
  color: #fff;
  background-color: #484848;
  vertical-align: middle;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  font-size: 25px;
  margin-top: 2px;
  height: 42px;
  display: block;
  padding: 0;
  width: 100%;
}

.fadeUp:hover,
.fadeUp:hover:focus {
  color: #ffffff;
  background-color: #333333;
  outline: 0;
}

/*响应式*/
@media screen and (max-width: 640px) {
  .article-right {
    display: none;
  }
  .article_exp_img {
    display: none;
  }
  .article_top .article_top_left {
    width: 100% !important;
    padding: 10px 15px !important;
    box-sizing: border-box;
  }
  .article_top .article_top_left img {
    display: none;
  }
  .list div > div:nth-child(2n) article {
    background: #f8fcfe;
  }
  .paging a {
    display: none !important;
  }
  .paging a:first-child {
    display: inline-block !important;
  }
  .paging a:last-child {
    display: inline-block !important;
  }

  .header .top_nav .top_t {
    display: none;
  }
  .header .navBg {
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    background: #000;
    opacity: 0.5;
    z-index: 5;
  }
  .header .top_nav {
    width: 100%;
    /*display: none;*/
    /*background: rgba(0, 0, 0, 0.5);*/
    height: 100%;
    position: fixed;
    z-index: 10;
    transition: 0.5s all;
    right: -600px;
  }
  .header .topShow {
    display: block;
    right: 0;
  }
  .header .top_nav .nav {
    height: 100%;
    position: absolute;
    background: #fff;
    right: 0;
    width: 60%;
  }
  .header .top_nav .nav li {
    width: 100%;
  }
  .header .top_nav .nav li a {
    display: block !important;
  }

  .navx {
    width: 30px;
    height: 30px;
    border-bottom: 2px solid #999;
    position: absolute;
    right: 25px;
    top: 20px;
    z-index: 10;
    transition: all 0.5s;
  }
  .navx:before {
    content: "";
    width: 100%;
    height: 2px;
    background: #999;
    margin-top: 9px;
    display: inline-block;
    float: left;
    transition: 0.5s all;
  }
  .navx:after {
    content: "";
    width: 100%;
    height: 2px;
    background: #999;
    margin-top: 9px;
    display: inline-block;
    float: left;
    transition: 0.5s all;
  }
  .navClose {
    right: 65%;
    top: 10px;
    z-index: 20;
    border-bottom: none;
  }
  .navClose:before {
    background: #fff;
    transform: rotate(45deg);
    margin-bottom: -5px;
  }
  .navClose:after {
    background: #fff;
    transform: rotate(-45deg);
    margin-top: 3px;
  }
}
</style>